<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
    <style>
        .haha {
            width: 500px;
            height: 500px;
            background-color: teal;
        }
    </style>
</head>

<body>
    <div id="app"> </div>
</body>
<script>
    const demo = {
        data () {
            return {
                msg: 'alex',
            }
        },
        template: `<div>demo==>{{msg}}</div>`
    }
    const demo2 = {
        data () {
            return {
                msg: 'GalaxySa',
            }
        },
        template: `<div>demo==>{{msg}}</div>`
    }
    let vm = {
        data () {
            return {
            }
        },
        components: {
            demo,
            demo2
        },
        template: ` <demo></demo><demo2 /><demo3 />`
    }
    let app = Vue.createApp(vm)
    // 全局组件的新建
    app.component('demo3', {
        template: `<div>demo2--全局组件</div>`
    })

    app.mount('#app')
</script>

</html>